#pragma once
/* Copyright (C) 2009 Vlad Roubtsov. All rights reserved. */

#include <stdexcept>

#include "vr/util/utility.hpp"

//----------------------------------------------------------------------------

#if defined (VR_ENABLE_ASSERTS)
#   define ASSERT_GUARD (true)
#else
#   define ASSERT_GUARD (false)
#endif

#define VR_SFAIL(msg) \
    { throw std::logic_error ("[" __VR_LOCATION "]"); }

#define VR_SASSERT(c) \
    { if (UNLIKELY (! (c))) { throw std::logic_error ("ASSERT FAILURE [" __VR_LOCATION "]: " #c); }}

#define VR_FASSERT(c) \
    { if (ASSERT_GUARD && UNLIKELY (! (c))) { throw std::logic_error ("ASSERT FAILURE [" __VR_LOCATION "]: " #c); }}

//----------------------------------------------------------------------------
